3.1257 \(\int (B \cos (c+d x)+C \cos ^2(c+d x)) \sqrt {\sec (c+d x)} \, dx\)

Optimal. Leaf size=101 \[ \frac {2 B \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 C \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {2 C \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d} \]

[Out]

2/3*C*sin(d*x+c)/d/sec(d*x+c)^(1/2)+2*B*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+
1/2*c),2^(1/2))*cos(d*x+c)^(1/2)*sec(d*x+c)^(1/2)/d+2/3*C*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*Elli
pticF(sin(1/2*d*x+1/2*c),2^(1/2))*cos(d*x+c)^(1/2)*sec(d*x+c)^(1/2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4221, 3010, 2748, 2639, 2635, 2641} \[ \frac {2 B \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d}+\frac {2 C \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {2 C \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sqrt[Sec[c + d*x]],x]

[Out]

(2*B*Sqrt[Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/d + (2*C*Sqrt[Cos[c + d*x]]*EllipticF[(c
 + d*x)/2, 2]*Sqrt[Sec[c + d*x]])/(3*d) + (2*C*Sin[c + d*x])/(3*d*Sqrt[Sec[c + d*x]])

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 2639

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2*EllipticE[(1*(c - Pi/2 + d*x))/2, 2])/d, x] /; FreeQ[{
c, d}, x]

Rule 2641

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2*EllipticF[(1*(c - Pi/2 + d*x))/2, 2])/d, x] /; FreeQ
[{c, d}, x]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3010

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x
_Symbol] :> Dist[1/b, Int[(b*Sin[e + f*x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x
]

Rule 4221

Int[(u_)*((c_.)*sec[(a_.) + (b_.)*(x_)])^(m_.), x_Symbol] :> Dist[(c*Sec[a + b*x])^m*(c*Cos[a + b*x])^m, Int[A
ctivateTrig[u]/(c*Cos[a + b*x])^m, x], x] /; FreeQ[{a, b, c, m}, x] &&  !IntegerQ[m] && KnownSineIntegrandQ[u,
 x]

Rubi steps

\begin {align*} \int \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sqrt {\sec (c+d x)} \, dx &=\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {B \cos (c+d x)+C \cos ^2(c+d x)}{\sqrt {\cos (c+d x)}} \, dx\\ &=\left (\sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} (B+C \cos (c+d x)) \, dx\\ &=\left (B \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx+\left (C \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \cos ^{\frac {3}{2}}(c+d x) \, dx\\ &=\frac {2 B \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 C \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}+\frac {1}{3} \left (C \sqrt {\cos (c+d x)} \sqrt {\sec (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx\\ &=\frac {2 B \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{d}+\frac {2 C \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {\sec (c+d x)}}{3 d}+\frac {2 C \sin (c+d x)}{3 d \sqrt {\sec (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.13, size = 76, normalized size = 0.75 \[ \frac {\sqrt {\sec (c+d x)} \left (6 B \sqrt {\cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )+C \left (\sin (2 (c+d x))+2 \sqrt {\cos (c+d x)} F\left (\left .\frac {1}{2} (c+d x)\right |2\right )\right )\right )}{3 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sqrt[Sec[c + d*x]],x]

[Out]

(Sqrt[Sec[c + d*x]]*(6*B*Sqrt[Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2] + C*(2*Sqrt[Cos[c + d*x]]*EllipticF[(c +
 d*x)/2, 2] + Sin[2*(c + d*x)])))/(3*d)

________________________________________________________________________________________

fricas [F]  time = 0.69, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \sqrt {\sec \left (d x + c\right )}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2),x, algorithm="fricas")

[Out]

integral((C*cos(d*x + c)^2 + B*cos(d*x + c))*sqrt(sec(d*x + c)), x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \sqrt {\sec \left (d x + c\right )}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2),x, algorithm="giac")

[Out]

integrate((C*cos(d*x + c)^2 + B*cos(d*x + c))*sqrt(sec(d*x + c)), x)

________________________________________________________________________________________

maple [A]  time = 2.53, size = 229, normalized size = 2.27 \[ \frac {2 \sqrt {\left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, \left (-4 C \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 B \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )-C \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticF \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+2 C \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{3 \sqrt {-2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2),x)

[Out]

2/3*((2*cos(1/2*d*x+1/2*c)^2-1)*sin(1/2*d*x+1/2*c)^2)^(1/2)*(-4*C*cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^4+3*B*
(sin(1/2*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))-C*(sin(1/2
*d*x+1/2*c)^2)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticF(cos(1/2*d*x+1/2*c),2^(1/2))+2*C*cos(1/2*d*x+1/
2*c)*sin(1/2*d*x+1/2*c)^2)/(-2*sin(1/2*d*x+1/2*c)^4+sin(1/2*d*x+1/2*c)^2)^(1/2)/sin(1/2*d*x+1/2*c)/(2*cos(1/2*
d*x+1/2*c)^2-1)^(1/2)/d

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \sqrt {\sec \left (d x + c\right )}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^(1/2),x, algorithm="maxima")

[Out]

integrate((C*cos(d*x + c)^2 + B*cos(d*x + c))*sqrt(sec(d*x + c)), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \sqrt {\frac {1}{\cos \left (c+d\,x\right )}}\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/cos(c + d*x))^(1/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2),x)

[Out]

int((1/cos(c + d*x))^(1/2)*(B*cos(c + d*x) + C*cos(c + d*x)^2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (B + C \cos {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )} \sqrt {\sec {\left (c + d x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**(1/2),x)

[Out]

Integral((B + C*cos(c + d*x))*cos(c + d*x)*sqrt(sec(c + d*x)), x)

________________________________________________________________________________________